//
//  JKMacro.h
//  JKFoundation
//
//  Created by JK on 07/08/2017.
//  Copyright © 2017 Shanghai DataSeed Information Technology Co.,Ltd. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#pragma mark - Macros
#define JK_SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
#define JK_SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)
#define JK_SCREEN_MAX_LENGTH (MAX(JK_SCREEN_WIDTH, JK_SCREEN_HEIGHT))
#define JK_SCREEN_MIN_LENGTH (MIN(JK_SCREEN_WIDTH, JK_SCREEN_HEIGHT))
#define JK_SCREEN_SCALE [UIScreen mainScreen].scale
#define JK_SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
#define JK_SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)
#define JK_SCREEN_MAX_LENGTH (MAX(JK_SCREEN_WIDTH, JK_SCREEN_HEIGHT))
#define JK_SCREEN_MIN_LENGTH (MIN(JK_SCREEN_WIDTH, JK_SCREEN_HEIGHT))
#define JK_SCREEN_SCALE [UIScreen mainScreen].scale
#define JK_SEPARATOR_DIMENSION (JK_SCREEN_SCALE < 3.0 ? 0.5 : 0.5)
#define JK_IS_IPHONE_4_OR_LESS (JK_SCREEN_MAX_LENGTH < 568.0)
#define JK_IS_IPHONE_5 (JK_SCREEN_MAX_LENGTH == 568.0)
#define JK_IS_IPHONE_6 (JK_SCREEN_MAX_LENGTH == 667.0)
#define JK_IS_IPHONE_6P (JK_SCREEN_MAX_LENGTH > 667.0)
#define JK_IS_IPHONE_5_OR_LESS (JK_SCREEN_MAX_LENGTH <= 568.0)
#define JK_IS_IPHONE_X (JKHasNeatBang())
#define JK_IS_IOS_10 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0)
#define JK_IS_IOS_9_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0)
#define JK_IS_IOS_11_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 11.0)

#pragma mark - Constants
extern NSString* const JKEmptyString;
extern NSString* const JKEmptyUUIDString;

#pragma mark - Functions
extern UIColor* JKColorHex(NSString* colorHex);
extern CGRect JKRectSetOriginX(CGRect rect, CGFloat originX);
extern void JKDispatchSyncOnMainQueue(void (^block)(void));
extern UIEdgeInsets JKSafeAreaInsets(void);
extern BOOL JKHasNeatBang(void);
